package com.ysx.ch03;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

@Component
public class SuccessAdvice implements MethodBeforeAdvice {

    private static final String MESSAGE_SUCCESS ="我会算";

    @Override
    public void before(Method method, Object[] args, Object target) throws Throwable {
        System.out.println(MESSAGE_SUCCESS);
    }
}
